﻿namespace Cubicle.Core.Processors.Transform
{
    public class ToStringTransformProcessor : InstructionRequestProcessor
    {
        #region Overrides of Processor<InstructionRequest>

        public ToStringTransformProcessor() : base(RequestType.Completed) { }

        public override InstructionRequest ConditionalProcess(InstructionRequest request)
        {
            var result = request.Result() == null 
                             ? null
                             : request.Result().ToString();

            request.Result(result);
            return request;
        }

        #endregion
    }
}